package com.coolingme.properties;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * 基础支付宝配置类
 * 
 * @author wangyue
 * @date 2019-06-20 00:00:51
 */
@Configuration // 表明这是一个配置类
@PropertySource("classpath:properties/alipay.properties")
public class DefaultAlipayProperties {
	/**
	 * 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	 */
	public static String APP_ID;

	/**
	 * 商户私钥 您的PKCS8格式RSA2私钥
	 */
	public static String RSA_PRIVATE_KEY;

	/**
	 * 支付宝公钥
	 */
	public static String ALIPAY_PUBLIC_KEY;

	/**
	 * 请求网关地址,支付宝网关<br>
	 * public static String URL = "https://openapi.alipay.com/gateway.do";<br>
	 * 沙箱网关
	 */
	public static String URL;

	/**
	 * 编码
	 */
	public static String CHARSET;

	/**
	 * 返回格式
	 */
	public static String FORMAT;

	/**
	 * 签名方式,RSA2
	 */
	public static String SIGN_TYPE;

	/**
	 * 支付宝日志文件目录
	 */
	public static String LOG_PATH;

	@Value("${APP_ID}")
	public void setAPP_ID(String APP_ID) {
		DefaultAlipayProperties.APP_ID = APP_ID;
	}

	@Value("${RSA_PRIVATE_KEY}")
	public void setRSA_PRIVATE_KEY(String RSA_PRIVATE_KEY) {
		DefaultAlipayProperties.RSA_PRIVATE_KEY = RSA_PRIVATE_KEY;
	}

	@Value("${ALIPAY_PUBLIC_KEY}")
	public void setALIPAY_PUBLIC_KEY(String ALIPAY_PUBLIC_KEY) {
		DefaultAlipayProperties.ALIPAY_PUBLIC_KEY = ALIPAY_PUBLIC_KEY;
	}

	@Value("${URL}")
	public void setURL(String URL) {
		DefaultAlipayProperties.URL = URL;
	}

	@Value("${CHARSET}")
	public void setCHARSET(String CHARSET) {
		DefaultAlipayProperties.CHARSET = CHARSET;
	}

	@Value("${FORMAT}")
	public void setFORMAT(String FORMAT) {
		DefaultAlipayProperties.FORMAT = FORMAT;
	}

	@Value("${SIGN_TYPE}")
	public void setSIGN_TYPE(String SIGN_TYPE) {
		DefaultAlipayProperties.SIGN_TYPE = SIGN_TYPE;
	}

	@Value("${LOG_PATH}")
	public void setLOG_PATH(String LOG_PATH) {
		DefaultAlipayProperties.LOG_PATH = LOG_PATH;
	}

}
